package Day10;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        int[][] ints = new int[][] {{1,0,1},{1,-1,-1},{1,-1,0}};
        System.out.println(checkWon(ints));
    }

    public static boolean checkWon(int[][] board) {
         if (board[0][0] == 1) {
             if (board[1][1] == 1) {
                 return board[2][2] == 1;
             } else if (board[1][0] == 1) {
                 return board[2][0] == 1;
             } else {
                 if (board[0][1] == 1) {
                     return board[0][2] == 1;
                 }
             }
         } else if (board[0][1] == 1) {
             if (board[1][1] == 1) {
                 return board[2][1] == 1;
             } else {
                 return false;
             }
         }else if (board[0][2] == 1) {
             if (board[1][2] == 1) {
                 return board[2][2] == 1;
             } else {
                 return false;
             }
         } else if (board[1][0] == 1) {
             if (board[1][1] == 1) {
                 return board[2][1] == 1;
             } else {
                 return false;
             }
         } else if (board[2][0] == 1) {
             if (board[2][1] == 1) {
                 return board[2][2] == 1;
             } else {
                 return false;
             }
         }
         return false;
    }

    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();


        int lp = letPoint(s);
        int np = numPoint(s);
        int cp = charPoint(s);
        int bp = bonusPoint(lp, np, cp);
        System.out.println(
                getLevel(
                        lp + bp + lenPoint(s)
                                + np + charPoint(s)
                ));
    }

    public static int letPoint (String s) {
        char[] chars = s.toCharArray();
        boolean big = false;
        boolean small = false;
        for (char aChar : chars) {
            if (aChar >= 'A' && aChar <= 'Z') {
                big = true;
            } else if (aChar >= 'a' && aChar <= 'z') {
                small = true;
            }
        }

        if (big && small) {
            return 20;
        } else if (big || small) {
            return 10;
        }
        return 0;
    }

    public static int bonusPoint (int lp, int np, int cp) {
        boolean lpb = false;
        boolean lppb = false;
        boolean npb = false;
        boolean cpb = false;
        if (lp > 0) {
            lpb = true;
            if (lp == 20) {
                lppb =true;
            }
        }
        if (np > 0) {
            npb = true;
        }
        if (cp > 0) {
            cpb = true;
        }

        int ret = 0;
        if (lpb && npb) {
            ret += 2;
            if (cpb) {
                ret += 1;
                if (lppb) {
                    ret += 2;
                }
            }
        }
        return ret;
    }

    public static int lenPoint (String s) {
        int len = s.length();
        if (len < 5) {
            return 5;
        } else if (len < 8) {
            return 10;
        } else {
            return 25;
        }
    }

    public static int numPoint (String s) {
        int ret = 0;
        char[] chars = s.toCharArray();

        for (char aChar : chars) {
            if (aChar <= '9' && aChar >= '0') {
                ret++;
            }
        }

        if (ret == 0) {
            return 0;
        } else if (ret == 1) {
            return 10;
        } else {
            return 20;
        }

    }

    public static int charPoint (String s) {
        int ret = 0;
        char[] chars = s.toCharArray();

        for (char aChar : chars) {
            if ((aChar < 'A' || aChar > 'Z') && (aChar > '9' || aChar < '0')) {
                ret++;
            }
        }

        if (ret == 0) {
            return 0;
        } else if (ret == 1) {
            return 10;
        } else {
            return 25;
        }

    }

    public static String getLevel (int i) {
        if (i >= 90) {
            return "VERY_SECURE";
        } else if (i >=80) {
            return "SECURE";
        } else if (i >= 70) {
            return "VERY_STRONG";
        } else if (i >= 60) {
            return "STRONG";
        } else if (i >= 50) {
            return "AVERAGE";
        } else if (i >= 25) {
            return "WEAK";
        } else {
            return "VERY_WEAK";
        }
    }

}
